import request from "./request";

//意向学员
export class IntentStudentApi {

    getIntentStudentList({page, search}) {
        let data = {page, search}
        return request({url: '/api/v1/org/getIntendedList', method: 'post', data})
    }

    getIntentStudentDetail(sid) {
        let data = {sid}
        return request({url: '/api/v1/org/getIntendedDetail', method: 'post', data})
    }

    addTraceRecord({sid, type, created_at, content}) {
        let data = {sid, type, created_at, content}
        return request({url: '/api/v1/org/addTracerecord', method: 'post', data})
    }
}

//添加意向学员
export class AddIntentStudentApi {
    //获取来源渠道下拉列表
    getChannelList() {
        return request({url: '/api/v1/org/getChannel', method: 'get'})
    }

    //获取称谓列表列表接口
    getAppellations() {
        return request({url: '/api/v1/org/getAppellations', method: 'get'})
    }

    //获取课程列表
    getCourseList() {
        return request({url: '/api/v1/org/getCourse', method: 'get'})
    }

    addIntentStudent(
        {
            realname,
            appellation,
            phone,
            sex,
            birthday,
            channel_id,
            intention_level,
            intention_course,
            adviser,
            school,
            home_address,
            remark
        }) {
        let data = {
            realname,
            appellation,
            phone,
            sex,
            birthday,
            channel_id,
            intention_level,
            intention_course,
            adviser,
            school,
            home_address,
            remark
        }
        return request({url: '/api/v1/org/addIntendedStudent', method: 'post', data})
    }
}
